package org.bigdata.framework.core.mapper;

import org.apache.ibatis.annotations.Select;
import org.bigdata.framework.core.model.QuestionDatabase;
import com.baomidou.mybatisplus.mapper.BaseMapper;

/**
 * <p>
 * Mapper接口
 * </p>
 *
 * @author dal.liweiqiang
 * @since 2019-11-19
 */
public interface QuestionDatabaseMapper extends BaseMapper<QuestionDatabase> {
	@Select("select count(*) FROM course_question c,question q,question_database d,`order` o where c.question_id = q.id AND d.id=q.question_database_id AND o.resource_id=c.course_id AND d.id=#{id}")
	public Integer courseOrderQuetionBaseCount(String id);
	@Select("select count(*) FROM online_question c,question q,question_database d,`order` o where c.question_id = q.id AND d.id=q.question_database_id AND o.resource_id=c.online_id AND d.id=#{id}")
	public Integer onlineOrderQuetionBaseCount(String id);
}